<template>
  <div>
    <el-table :data="tableData" :header-cell-style="headClass" border stripe style="width: 100%" height="90%">
      <el-table-column prop="operateUserName" label="操作人姓名"></el-table-column>
      <el-table-column prop="operateIp" label="操作人IP"></el-table-column>
      <el-table-column prop="operateTime" label="操作时间" align="center"></el-table-column>
      <el-table-column prop="operateRemark" label="操作内容"></el-table-column>
    </el-table>
    <div class="paging">
      <el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange" :total="pageAll"></el-pagination>

    </div>
  </div>
</template>

<script>
export default {
  name: "operationLog",
  data() {
    return {
      pageIndex: 1,
      pageAll:0,
      tableData: []
    };
  },
  mounted() {
    var that = this;
    that.$nextTick(()=>{
      that.getOperationLog();
    })
  },
  methods: {
    // 头部样式
    headClass:function(){
      return 'text-align: center;'
    },
    getOperationLog: function() {
      var that = this;
      that.$api.systemSetup.GetOperationLog(this.pageIndex).then(res => {
        //console.log("获取操作日志列表", res);
        that.tableData = res.data.result.list;
        that.pageAll = res.data.result.total;
      });
    },
    // 分页页面切换
    handleCurrentChange: function(val) {
      this.pageIndex = val;
      this.getOperationLog();
    },
  }
};
</script>

<style>
</style>
